package com.collect.zambia.zhiScene.zhiAuditer.zhiFollow;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.View;

import androidx.viewpager.widget.ViewPager;

import com.collect.zambia.R;
import com.collect.zambia.zhiBase.BaseFragment;
import com.collect.zambia.zhiBean.zhiSend.ZHISCustomerRepayOrderListEntity;
import com.collect.zambia.zhiBean.zhiSend.ZHISDailyCaseEntity;
import com.collect.zambia.zhiBean.zhiSend.ZHISPerfermanceEntity;
import com.collect.zambia.zhiScene.zhiAuditer.zhiRoot.ZHIRootAuditerFragmentInterface;
import com.collect.zambia.zhiScene.zhiWidget.zhiNavigationBar.ZHINavigationBar;
import com.google.android.material.tabs.TabLayout;

import butterknife.BindView;

@SuppressLint("NonConstantResourceId")
public class ZHIAuditerFollowFragment extends BaseFragment implements ZHIRootAuditerFragmentInterface {

    @BindView(R.id.navigationBar)
    ZHINavigationBar navigationBar;

    @BindView(R.id.tablayout_auditer_follow)
    TabLayout tablayout_auditer_follow;

    @BindView(R.id.viewpager_auditer_follow)
    ViewPager viewpager_auditer_follow;

    @SuppressLint("StaticFieldLeak")
    private static ZHIAuditerFollowFragment mInstance;

    public static ZHIAuditerFollowFragment getInstance(){
        return mInstance;
    }

    private ZHIAuditerFollowPageAdapter mZHIAuditerFollowPageAdapter;
    private ZHIRootAuditerFragmentInterface mZHIRootAuditerFragmentInterface;

    @Override
    protected void initInjector() {
//        mFragmentComponent.inject(this);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_auditer_follow;
    }

    @Override
    protected void initView(View view) {
        try {
            mInstance = this;

            //隐藏左返回
            navigationBar.hideLeft();

            // 创建适配器
            mZHIAuditerFollowPageAdapter = new ZHIAuditerFollowPageAdapter(requireActivity().getSupportFragmentManager());
            viewpager_auditer_follow.setOffscreenPageLimit(1);
            viewpager_auditer_follow.setAdapter(mZHIAuditerFollowPageAdapter);

            // 将 TabLayout 与 ViewPager 关联
            tablayout_auditer_follow.setupWithViewPager(viewpager_auditer_follow);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try {
            mZHIRootAuditerFragmentInterface = (ZHIRootAuditerFragmentInterface) activity;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onShowFilterDaily() {
        mZHIRootAuditerFragmentInterface.onShowFilterDaily();
    }

    @Override
    public void onShowFilterPerformanceAmount() {

    }

    @Override
    public void onShowFilterPerformanceMember() {
    }

    @Override
    public void onReloadGroupUserList() {

    }

    @Override
    public void onReloadDailyListForPartRepayFlag() {

    }

    @Override
    public ZHISPerfermanceEntity onGetPerfermanceFilterMemberParams() {
        return mZHIRootAuditerFragmentInterface.onGetPerfermanceFilterMemberParams();
    }

    @Override
    public ZHISPerfermanceEntity onGetPerfermanceFilterAmountParams() {
        return mZHIRootAuditerFragmentInterface.onGetPerfermanceFilterAmountParams();
    }

    @Override
    public ZHISPerfermanceEntity onGetPerfermanceFilterOrderParams() {
        return mZHIRootAuditerFragmentInterface.onGetPerfermanceFilterOrderParams();
    }

    @Override
    public ZHISDailyCaseEntity onGetDailyFilterParams() {
        return mZHIRootAuditerFragmentInterface.onGetDailyFilterParams();
    }

    @Override
    public void onShowFilterFollow() {
         mZHIRootAuditerFragmentInterface.onShowFilterFollow();
    }

    @Override
    public ZHISCustomerRepayOrderListEntity onGetFollowFilterParams() {
        return mZHIRootAuditerFragmentInterface.onGetFollowFilterParams();
    }

    @Override
    public ZHISCustomerRepayOrderListEntity onGetFollowFilterD0Params() {
        return mZHIRootAuditerFragmentInterface.onGetFollowFilterD0Params();
    }

    @Override
    public ZHISCustomerRepayOrderListEntity onGetFollowFilterD1Params() {
        return mZHIRootAuditerFragmentInterface.onGetFollowFilterD1Params();
    }

    public void refreshData() {

    }
}